<?php

namespace app\meizhuangapi\model\user;

use app\api\model\user\DealerLog as CapitalnModel;

/**
 * 用户赏金变动明细模型
 * Class PointsLog
 * @package app\api\model\user
 */
class DealerLog extends CapitalnModel
{
    /**
     * 获取日志明细列表
     */
    public function getList($userId,$page,$type){
        $limit = 15;
        $offset = ($page - 1) * $limit;
        // 获取列表数据
        return $this->alias('w')
            ->join('yoshop_user u','w.user_id = u.user_id')
            ->where('w.user_id', '=', $userId)
            ->where(['w.flow_type'=>$type])
            ->order(['w.create_time' => 'desc'])
            ->field('w.*,u.nickName,u.username')
            ->limit($offset, $limit)
            ->select();

    }
}